<?php

import('com.yamvc.view.Mediator');
import("com.simpleApplication.events.PageEvent");

class PageMediator extends Mediator {
	public function __construct(ITemplate $template){
		parent::__construct($template);
		$this->addEventListener(PageEvent::SHOW_PAGE,new EventListener($this,"showPageHanler"));
	}
	
	public function showPageHanler(PageEvent $event){
		$page = Model::instance()->retreaveProxy("pagesDataProxy")->getPage($event->getPageId());
		$this->_template->putVariable("pageTitle",$page->title);
		$this->_template->putVariable("pageContent",$page->content);
	}
}

?>